{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Supervised Learning Example: Linear regression"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Alessandro Parisi \n",
      "last updated: 2019-01-14 \n",
      "\n",
      "CPython 3.5.4\n",
      "IPython 6.1.0\n",
      "\n",
      "numpy 1.13.3\n",
      "pandas 0.20.3\n",
      "matplotlib 2.0.2\n",
      "sklearn 0.20.0\n",
      "seaborn 0.8.0\n"
     ]
    }
   ],
   "source": [
    "%load_ext watermark\n",
    "%watermark -a \"Alessandro Parisi\" -u -d -v -p numpy,pandas,matplotlib,sklearn,seaborn\n",
    "# to install watermark launch 'pip install watermark' at command line\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xd8leX9//HXlR0CJOwRCAkCYS8Doli1osWBQrW2at1a\n2n77bR39otgvU/QHFTsc9Vupu1qtrZYpAgpupYQhJCFhhJUwwkqA7ORcvz8IlpF51n3Oyfv5ePCQ\n3LnPuT+nkDdXP/d1Xbex1iIiIsEvzOkCRETEOxToIiIhQoEuIhIiFOgiIiFCgS4iEiIU6CIiIUKB\nLiISIhToIiIhQoEuIhIiIvx5sfbt29vk5GR/XlJEJOitXbv2kLW2Q0Pn+TXQk5OTSU9P9+clRUSC\nnjFmV2POU8tFRCREKNBFREKEAl1EJEQo0EVEQkSDgW6MedkYU2CMyTjt2FxjTLYxZqMx5l/GmATf\nlikiIg1pzAj9VeCqs46tAAZaawcDW4BHvVyXiEjAmL8+n9FzVpIyeQmj56xk/vp8p0uqVYOBbq39\nFDhy1rHl1tqqmi+/Brr5oDYREcfNX5/Po+9tIr+wF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U5ErkJg\ngg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x2a62bba2b0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "from sklearn.linear_model import LinearRegression\n",
    "\n",
    "pool = np.random.RandomState(10)\n",
    "x = 5 * pool.rand(30)\n",
    "y = 3 * x - 2 + pool.randn(30)\n",
    "\n",
    "# y = 3x - 2;\n",
    "lregr = LinearRegression(fit_intercept=False)\n",
    "\n",
    "X = x[:, np.newaxis]\n",
    "lregr.fit(X, y)\n",
    "\n",
    "lspace = np.linspace(0, 5)\n",
    "X_regr = lspace[:, np.newaxis]\n",
    "y_regr = lregr.predict(X_regr)\n",
    "\n",
    "plt.scatter(x, y);\n",
    "plt.plot(X_regr, y_regr);"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Unsupervised Learning Example: Clustering"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<seaborn.axisgrid.FacetGrid at 0x2a6095f5f8>"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAABDAAAAFgCAYAAABNIolGAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3X9w4/d93/nXG1+ABLDELrlaUmtpuZEoy8N4HSdVVEdO\nNRzGdRPJzcnTnnPj7d3FzSW3TCqPLzdNRu413bab9k66ZPKrceLdaXKtL4l0d7o43rnIzo+qDJ2O\ntrYs2bE32kQypZq7sgTuLpcEFwABfL+f+wMEF+CCBED8JPB82BySX37x/X6wY38BvL/vH+acEwAA\nAAAAQC8LdXsBAAAAAAAAtRDAAAAAAAAAPY8ABgAAAAAA6HkEMAAAAAAAQM8jgAEAAAAAAHoeAQ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5LcDzzFYFntt4Fdbata88zW\ndszWfpitWk7majvmaj/M1TFlclZtSZIkSZKktWrN30IiSZIkSZL65wBDkiRJkiR1zwGGJEmSJEnq\nngMMSZIkSZLUPQcYkiRJkiSpew4wpEVKciLJ00meS/LPSTYOr/9ckvuS/GeSJ5M8mOQXF3zdHUle\nS/KWBdd+NslXk/w4yWdb9CNJrZmrkrT8zFZNMwcY0uIdqaqrqupK4Cjw0QwOMN8NPFZVb6uq9wF3\nAhcu+LodwLeAX19w7TXgz4E/Wp3SJalL5qokLT+zVVPLAYY0nq8BvwD8CnCsqv5+/j9U1TNV9TWA\nJG8DzgH+jMGTwvxjflJVX2fwpCBJMlclaSWYrZoqDjCkESVZB9wEPAtcCTx5moffCtzH4MnjHUku\nPM1jJWlNMlclafmZrZpGDjCkxduQ5GngCeAl4J5FfM0O4L6q+inwBeA3VrA+SZo05qokLT+zVVNr\nXesCpAlypKquWnghyV7gI6d6cJJ3Am8HHh7cdshZwHcBN0CSpAFzVZKWn9mqqeUKDGlpHgXelOS2\n+QtJ3pXklxlMsv+iqi4evm0GNif5+VbFStIEMFclafmZrZoKqarWNUgTIcmPq+qcU1zfDHwGeB+D\nDY6+B9wBPATcXFUvLnjsp4H/qapPJfke8GYGU+4fATdU1fMr3Yck9cJclaTlZ7ZqmjnAkCRJkiRJ\n3fMWEkmSJEmS1D0HGJIkSZIkqXsOMCRJkiRJUvccYEiSJEmSpO45wJAkSZIkSd1zgCFJkiRJkrrn\nAEOSJEmSJHXv/wAsffyoguKfPQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x2a60aac940>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import seaborn as sns\n",
    "\n",
    "data_df = pd.read_csv(\"../datasets/clustering.csv\")\n",
    "data_df.describe()\n",
    "\n",
    "X_data = data_df.drop('class_1', axis=1)\n",
    "y_data = data_df['class_1']\n",
    "\n",
    "from sklearn.decomposition import PCA   \n",
    "pca = PCA(n_components=2)               \n",
    "pca.fit(X_data)                         \n",
    "X_2D = pca.transform(X_data)            \n",
    "\n",
    "data_df['PCA1'] = X_2D[:, 0]\n",
    "data_df['PCA2'] = X_2D[:, 1]\n",
    "\n",
    "from sklearn.mixture import GaussianMixture         \n",
    "gm = GaussianMixture(n_components=3, covariance_type='full')     \n",
    "\n",
    "gm.fit(X_data)                         \n",
    "y_gm = gm.predict(X_data)              \n",
    "\n",
    "\n",
    "data_df['cluster'] = y_gm\n",
    "sns.lmplot(\"PCA1\", \"PCA2\", data=data_df, col='cluster', fit_reg=False)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Simple Neural Network Example: Perceptron"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAEWCAYAAABmE+CbAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHNZJREFUeJzt3X90VOd95/H3V2IkAQLJAuyCwEIx4KUF1g6YcOIssR2S\nGJpfzllv063jk603OOds07hpfqzBdVxvbJKmddt1uj2lwU3TeFPXcWLSBG/tHNtLTI9jg9dBxGqw\nMcEg5NhCFiBAaBi++8dcgQTSzEiM5rlz5/M6h3M0c6/mfi2P9Jnnx30ec3dERESqQhcgIiLxoEAQ\nERFAgSAiIhEFgoiIAAoEERGJKBBERARQIIiISESBIIlhZr80sxNm1mtmvzKzb5pZfei6BkT1rQpd\nh8hIFAiSNB9093rg7cAy4I7RfLOZTRiXqmJ+bRFQIEhCuXsH8BiwyMwazGyTmXWaWYeZfdnMqgHM\n7BNmts3M/tzMDgF3Rc9/0szazeyomb1kZm+Pnp9lZo+Y2ZtmttfMfn/gmmZ2l5l918weir7vBTP7\n99GxfwAuBf45asF8wczmmpmb2S1m9hrwZHTuh8zs52bWY2ZPm9nCQdf4pZl9zsx2mtnh6F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Ex+7gZMdvdeM0sB\nzwCfcfdni3kdtRCKrJyX9nb3x939VPTwWWB2yHpGw93b3f0Xoeso0HLgFXd/1d37gX8ku4RL7Ln7\nVqA7dB1j4e6d7v5C9PVRoB1oDltVYTyrN3qYiv4V/W+LAmEcmNk9ZrYf+B3Kd/Of3wUeC11EQjUD\n+wc9PkCZ/GFKCjObC1wJ/DRsJYUzs2ozexF4A3jC3YteuwJhDIq1tHcI+WqPzlkPnCJbf2wUUrtI\nPmZWDzwC3HZOiz7W3D0T7TI5G1huZkXvsgu2QU45K+elvfPVbmafAD4AvMdjNsA0ip973HUAcwY9\nnh09J+Ms6n9/BHjQ3b8Xup6xcPceM3sKuB4o6uC+WghFVs5Le5vZ9cAXgA+5+/HQ9STY88B8M2s1\nsxrgY8APAteUeNHA7Cag3d3vC13PaJjZjIFZf2Y2keyEhKL/bdEsoyIb69LecWBmrwC1wKHoqWfL\naIbUDcD9wAygB3jR3d8ftqqRmdka4C+AauABd78ncEkFMbPvANeQXYb5V8CX3H1T0KIKZGbvAn4C\ntJH9/QRY5+5bwlVVGDNbAvw92fdLFfBP7n530a+jQBAREVCXkYiIRBQIIiICKBBERCSiQBAREUCB\nICIiEQWCyBhFq2fuNbOm6PFF0eO5YSsTGRsFgsgYuft+4K+Br0RPfQXY6O6/DFaUyAXQfQgiFyBa\nCmEH8ADwSeAKd0+HrUpkbLSWkcgFcPe0mX0e+D/A+xQGUs7UZSRy4VYDnUBZbRgjci4FgsgFMLMr\nyC40tgL4g2hXLpGypEAQGaNo9cy/Jruu/mvA14A/DVuVyNgpEETG7pPAa+7+RPT4fwELzezdAWsS\nGTPNMhIREUAtBBERiSgQREQEUCCIiEhEgSAiIoACQUREIgoEEREBFAgiIhL5/xuwC0d3a2b7AAAA\nAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x2a5d374470>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from matplotlib.colors import ListedColormap\n",
    "\n",
    "# Thanks to Sebastian Raschka for 'plot_decision_regions' function\n",
    "def plot_decision_regions(X, y, classifier, resolution=0.02):\n",
    "\n",
    "    # setup marker generator and color map\n",
    "    markers = ('s', 'x', 'o', '^', 'v')\n",
    "    colors = ('red', 'blue', 'lightgreen', 'gray', 'cyan')\n",
    "    cmap = ListedColormap(colors[:len(np.unique(y))])\n",
    "\n",
    "    # plot the decision surface\n",
    "    x1_min, x1_max = X[:, 0].min() - 1, X[:, 0].max() + 1\n",
    "    x2_min, x2_max = X[:, 1].min() - 1, X[:, 1].max() + 1\n",
    "    xx1, xx2 = np.meshgrid(np.arange(x1_min, x1_max, resolution),\n",
    "                         np.arange(x2_min, x2_max, resolution))\n",
    "    Z = classifier.predict(np.array([xx1.ravel(), xx2.ravel()]).T)\n",
    "    Z = Z.reshape(xx1.shape)\n",
    "    plt.contourf(xx1, xx2, Z, alpha=0.4, cmap=cmap)\n",
    "    plt.xlim(xx1.min(), xx1.max())\n",
    "    plt.ylim(xx2.min(), xx2.max())\n",
    "\n",
    "    # plot class samples\n",
    "    for idx, cl in enumerate(np.unique(y)):\n",
    "        plt.scatter(x=X[y == cl, 0], y=X[y == cl, 1],\n",
    "                    alpha=0.8, c=cmap(idx),\n",
    "                    marker=markers[idx], label=cl)\n",
    "\n",
    "from sklearn.linear_model import perceptron\n",
    "\n",
    "from sklearn.datasets import make_classification\n",
    "X, y = make_classification(30, 2, 2, 0, weights=[.3, .3], random_state=300) \n",
    "\n",
    "plt.scatter(X[:,0], X[:,1], s=50)\n",
    "\n",
    "pct = perceptron.Perceptron(max_iter=100, verbose=0, random_state=300, fit_intercept=True, eta0=0.002)\n",
    "pct.fit(X, y)\n",
    "\n",
    "plot_decision_regions(X, y, classifier=pct)\n",
    "plt.title('Perceptron')\n",
    "plt.xlabel('X')\n",
    "plt.ylabel('Y')\n",
    "plt.show()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Py35",
   "language": "python",
   "name": "py35"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
